import 'package:flutter/cupertino.dart';
import 'package:schoollifedemo/base/dio_network_util.dart';
import 'package:schoollifedemo/base/url_contract.dart';
import 'package:schoollifedemo/commonwidget/common_base_viewmodel.dart';

class EditFriendCircleViewModel extends BaseViewModel {
  // 返回上一页
  void backPage(BuildContext context) {
    getApplication().getRouter()?.pop(context);
  }

  // 发布动态
  Future<Map<String, dynamic>?> publishNews({
    // required String whoPublish, // 谁评论
    required String msg, // 说说内容
    String? location, // 说说地点
    String? timestamps, // 发送时间
  }) async {
    String? account = getApplication().getLoginAccount();
    final params = <String, dynamic>{};
    params['whoPublish'] = account;
    params['msg'] = msg;
    params['location'] = location;
    params['timestamps'] = timestamps;
    Map<String, dynamic>? result =
        await getNetworkUtil().postHttp(UrlContract.addFriendCircle, params: params);
    return result;
  }
}
